package com.itcast.LocalDate.Demo01;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/*
要写注释哦!!!
*/
public class Test2 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = now.format(dtf);
        System.out.println(format);

        String str="2000-11-26 12:02:05";
        LocalDateTime parse = LocalDateTime.parse(str, dtf);
        System.out.println(parse);
    }
}
